package com.hdd.pojo;

import com.sun.org.apache.bcel.internal.generic.NEW;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @BelongsProject: demo2
 * @BelongsPackage: com.hdd.pojo
 * @Author: songYuHang
 * @CreateTime: 2025-04-02  10:00
 * @Description: TODO
 * @Version: 1.0
 */

public class ThreadPoolExecutorConfig {

    public static ThreadPoolExecutor ThreadPoolExecutor() {
        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
                5,
                10,
                60,
                TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(10, true),
                new ThreadPoolExecutor.AbortPolicy()
        );
        return threadPoolExecutor;
    }

}
